<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" href="{:config('web.cdn')}/favicon.ico">
    <title>headers在线转换工具</title>
    <meta name="keywords" content="headers转换,headers转数组,headers转json">
    <meta name="description" content="免费的在线抓换工具，可以将从浏览器复制出来的headers转换为你想要的格式，如数组，json格式。更多免费的工具尽在micuer.com网站。我们着力于打造优秀的免费的在线工具">
    {include file="public:head" /}
</head>
<body>
{include file="public:header_nav" /}
<div class="layui-fuild" style="min-height: 100%">
        <div class="fly-panel fly-panel-user tools">
            <div class="layui-tab layui-tab-brief" lay-filter="demo">
                {include file="tools:nav" /}
                <br>
                <br>
                <hr>
                <blockquote class="layui-elem-quote">填写需要转换的代码</blockquote>
                <textarea style="width: 49%;float:left;" rows="20" id="textarea" name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
                <textarea style="width: 49%;float:left; margin-left: 2%" rows="20" id="complate" name="desc" placeholder="转换完成" class="layui-textarea"></textarea>
                <div class="clear"></div>
                <input name="type" type="radio" value="array">转为PHP数组
                &nbsp;&nbsp;&nbsp;
                <input name="type"  type="radio" value="json">转为JSON

                <div class="clear"></div>
                <button type="button" class="layui-btn layui-btn-fluid" onclick="clear_html()">一键转换</button>

                <div class="clear"></div>


            </div>
        </div>
    </div>


{include file="public/footer"}

<script>

    //
    function clear_html(){
        var t = $("#textarea").val();
        if(!t){
            error("请先输入需要转换的内容内容");
            return false;
        }
        var url = "{:url('')}";
        var data = {
            t:t
            ,type:$("input[name=type]:checked").val()
        }
        $.post(url,data,function (e) {
            $("#complate").val(e);
        })
    }


</script>
